package com.hc.server.conn.mall;

import org.json.JSONException;
import org.json.JSONObject;

public class MallRequest {
	
	StringBuffer req;
	boolean isFirst;
	
	public MallRequest(){
		req = new StringBuffer();
		isFirst = true;
	}
	
	public void put(String key, Object value){
//		try{
//			req.put(key, value);
//		}catch (JSONException e) {
//		}
		if(!isFirst){
			req.append("&");	
		}
		req.append(key);
		req.append("=");
		req.append(value);
		if(isFirst){
			isFirst = false;
		}
	}
	
	public void put(String key, int value){
//		try{
//			req.put(key, value);
//		}catch (JSONException e) {
//		}
		if(!isFirst){
			req.append("&");	
		}
		req.append(key);
		req.append("=");
		req.append(value);
		if(isFirst){
			isFirst = false;
		}
	}
	
	public String toString(){
		return req.toString();
	}
}
